package com.itmg.analyze.jp.model;

import java.io.Serializable;

/**
 *  url参数 getURLPara获得匹配好的url
 * @author xuehaipeng
 * @version 1.0
 * */
public class YahooSearchParamModel implements Serializable {

	private static final long serialVersionUID = 1L;
	private String appid;  //appid
	private String affiliate_type; //Yahoo! JAPAN成果报酬型广告(yid)和价值贸易成果报酬型广告(vc)的选择
	private String affiliate_id; //Yahoo! JAPAN成果报酬型广告ID或，输入价值贸易成果报酬型广告ID
	private String callback; //为了输入作为JSONP输出的时候的call back函数名的参数。输入以UTF-8编码了的字符串
	private String query; //关键字检索。(请利用UTF-8被编码了的字符串。)
	private String type; //all还包含全查询文字的检索结果。any还含查询文字的其中哪个的检索结果
	private Integer jan; //根据JAN编码检索商品
	private Integer isbn; //根据ISBN编码(书籍编码)检索商品
	private Integer category_id; //由于范畴ID的商品的精练检索。范畴ID名单，根据范畴ID取得API可以取得
	private Integer product_id; //由于产品ID的商品检索
	private Integer person_id; //由于人物ID的商品检索
	private Integer brand_id; //由于品牌ID的商品检索
	private String store_id; //店的ID指定检索
	private Integer price_from; //检索价格指定(最低价格)下面价格以上
	private Integer price_to; //检索不满价格指定(最高价格)下面价格
	private Integer hits; //取得的检索结果数。默认20，最大值50
	private Integer offset; //从第几件使之表示(第1件0的)设定
	private String sort; //指定这些排列进行替换
	private String affiliate_from; //检索成果报酬型广告费用率指定(最低费用率)下面费用率以上
	private String affiliate_to; //检索不满成果报酬型广告费用率指定(最高费用率)下面费用率
	private String module; //取得检索结果中包含，价格幅度，辅助范畴和辅助范畴中包含的商品数的名单
	private String availability; //包含库存斑点。不指定的情况忽视库存状况
	private String discount; //包含廉售中商品斑点
	private String shipping; //默认没有设定

	
	public YahooSearchParamModel() {
	}


	public String getAppid() {
		return appid;
	}


	public void setAppid(String appid) {
		this.appid = appid;
	}


	public String getAffiliate_type() {
		return affiliate_type;
	}


	public void setAffiliate_type(String affiliate_type) {
		this.affiliate_type = affiliate_type;
	}


	public String getAffiliate_id() {
		return affiliate_id;
	}


	public void setAffiliate_id(String affiliate_id) {
		this.affiliate_id = affiliate_id;
	}


	public String getCallback() {
		return callback;
	}


	public void setCallback(String callback) {
		this.callback = callback;
	}


	public String getQuery() {
		return query;
	}


	public void setQuery(String query) {
		this.query = query;
	}


	public String getType() {
		return type;
	}


	public void setType(String type) {
		this.type = type;
	}


	public Integer getJan() {
		return jan;
	}


	public void setJan(Integer jan) {
		this.jan = jan;
	}


	public Integer getIsbn() {
		return isbn;
	}


	public void setIsbn(Integer isbn) {
		this.isbn = isbn;
	}


	public Integer getCategory_id() {
		return category_id;
	}


	public void setCategory_id(Integer category_id) {
		this.category_id = category_id;
	}


	public Integer getProduct_id() {
		return product_id;
	}


	public void setProduct_id(Integer product_id) {
		this.product_id = product_id;
	}


	public Integer getPerson_id() {
		return person_id;
	}


	public void setPerson_id(Integer person_id) {
		this.person_id = person_id;
	}


	public Integer getBrand_id() {
		return brand_id;
	}


	public void setBrand_id(Integer brand_id) {
		this.brand_id = brand_id;
	}


	public String getStore_id() {
		return store_id;
	}


	public void setStore_id(String store_id) {
		this.store_id = store_id;
	}


	public Integer getPrice_from() {
		return price_from;
	}


	public void setPrice_from(Integer price_from) {
		this.price_from = price_from;
	}


	public Integer getPrice_to() {
		return price_to;
	}


	public void setPrice_to(Integer price_to) {
		this.price_to = price_to;
	}


	public Integer getHits() {
		return hits;
	}


	public void setHits(Integer hits) {
		this.hits = hits;
	}


	public Integer getOffset() {
		return offset;
	}


	public void setOffset(Integer offset) {
		this.offset = offset;
	}


	public String getSort() {
		return sort;
	}


	public void setSort(String sort) {
		this.sort = sort;
	}


	public String getAffiliate_from() {
		return affiliate_from;
	}


	public void setAffiliate_from(String affiliate_from) {
		this.affiliate_from = affiliate_from;
	}


	public String getAffiliate_to() {
		return affiliate_to;
	}


	public void setAffiliate_to(String affiliate_to) {
		this.affiliate_to = affiliate_to;
	}


	public String getModule() {
		return module;
	}


	public void setModule(String module) {
		this.module = module;
	}


	public String getAvailability() {
		return availability;
	}


	public void setAvailability(String availability) {
		this.availability = availability;
	}


	public String getDiscount() {
		return discount;
	}


	public void setDiscount(String discount) {
		this.discount = discount;
	}


	public String getShipping() {
		return shipping;
	}


	public void setShipping(String shipping) {
		this.shipping = shipping;
	}
	public String getURLPara()
	{
		String url = "";
		if(appid != null)
		{
			url = url + "?appid="+appid;
		}
		if(affiliate_type != null)
		{
			url = url + "&affiliate_type="+affiliate_type;
		}
		if(affiliate_id != null)
		{
			url = url + "&affiliate_id="+affiliate_id;
		}
		if(callback != null)
		{
			url = url + "&callback="+callback;
		}
		if(query != null)
		{
			url = url + "&query="+query;
		}
		if(type != null)
		{
			url = url + "&type="+type;
		}
		if(jan != null)
		{
			url = url + "&jan="+jan;
		}
		if(isbn != null)
		{
			url = url + "&isbn="+isbn;
		}
		if(category_id != null)
		{
			url = url + "&category_id="+category_id;
		}
		if(product_id != null)
		{
			url = url + "&product_id="+product_id;
		}
		if(person_id != null)
		{
			url = url + "&person_id="+person_id;
		}
		if(brand_id != null)
		{
			url = url + "&brand_id="+brand_id;
		}
		if(store_id != null)
		{
			url = url + "&store_id="+store_id;
		}
		if(price_from != null)
		{
			url = url + "&price_from="+price_from;
		}
		if(price_to != null)
		{
			url = url + "&price_to="+price_to;
		}
		if(hits != null)
		{
			url = url + "&hits="+hits;
		}
		if(offset != null)
		{
			url = url + "&offset="+offset;
		}
		if(sort != null)
		{
			url = url + "&sort="+sort;
		}
		if(affiliate_from != null)
		{
			url = url + "&affiliate_from="+affiliate_from;
		}
		if(affiliate_to != null)
		{
			url = url + "&affiliate_to="+affiliate_to;
		}
		if(module != null)
		{
			url = url + "&module="+module;
		}
		if(availability != null)
		{
			url = url + "&availability="+availability;
		}
		if(discount != null)
		{
			url = url + "&discount="+discount;
		}
		if(shipping != null)
		{
			url = url + "&shipping="+shipping;
		}
		return url;
	}
}
